#ifndef cathlibcpp_rts_H
#define cathlibcpp_rts_H

// File:       rts.h
// Author:     (c) Miles Sabin, 1996
// Purpose:    replaces Acorn LibC++ and parts of SCL


#ifndef included_stddef_H
#define included_stddef_H
#include <stddef.h>                     // for size_t
#endif

#ifndef cathlibcpp_bool_H
#include "bool.h"
#endif

#ifndef cathlibcpp_config_H
#include "config.h"
#endif


// allocator registration

typedef void* (*rts_alloc_fn_t)(size_t);
typedef void  (*rts_free_fn_t)(void*);

void rts_set_alloc(rts_alloc_fn_t, rts_free_fn_t);
void rts_set_stack_alloc(rts_alloc_fn_t, rts_free_fn_t);


// stack allocation

void* rts_stack_alloc(size_t);
void  rts_stack_free(void*);

// library initialization/finalization
//
// If supplied, client functions,
//
//   extern "C" void rts_lib_init()
//   extern "C" void rts_lib_final(bool /*in_exit_handler*/, bool /*abnormal_termination*/)
//
// will be called before global ctors, (resp. after global dtors)
// have been called.

#endif
